package com.qf.utils;

import com.fasterxml.jackson.databind.ObjectMapper;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ResponseUtils {
    public static void response(HttpServletResponse response, ResultMsg error) throws IOException {
        ObjectMapper objectMapper=new ObjectMapper(); //jackson提供的一个对象
        //将对象以IO形式写出；
        objectMapper.writeValue(response.getOutputStream(),error);
    }
}
